<template>
  <div>
    <van-nav-bar title="消息" left-text="返回" right-text="..." left-arrow @click-left="onClickLeft" fixed  />
    <div class="chart-list" id="chart-list">
        <div class="user-message">1111</div>
    </div>
    <div>
        <div class="message"><textarea id="textarea"></textarea></div>
        <button id="btn1" >发送</button>
    </div>
  </div>
</template>
<script src="../index.js"></script>
<script src="../socket.io.js"></script>
<script>
    export default {
        let socket=register.socket('https://localhost:5000')
        btn1.click=function(){
            let val=textarea.value

            if(val.trim()==""){
                return
            }
            if(val.length()>100){
                return 
            }
            let keepAlive=$route.meta.keepAlive
            socket.emit('textmsg2',{
                text2:val,keepAlive,
            })
        }
    }
</script>

<style lang="scss" scoped>

</style>